package com.sand.entity;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Objects;

@Entity
@Table(name = "questiondetails", schema = "ssh_pro", catalog = "")
public class QuestiondetailsEntity {
    /**
     * @author <achao1441470436@gmail.com>
     * @since 2021/11/28/028 14:46
     */
    private int rid;
    private int questionId;
    private int userId;
    private String content;
    private Timestamp answerTime;

    @Id
    @Column(name = "rid")
    public int getRid() {
        return rid;
    }

    public void setRid(int rid) {
        this.rid = rid;
    }

    @Basic
    @Column(name = "questionId")
    public int getQuestionId() {
        return questionId;
    }

    public void setQuestionId(int questionId) {
        this.questionId = questionId;
    }

    @Basic
    @Column(name = "userId")
    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    @Basic
    @Column(name = "content")
    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    @Basic
    @Column(name = "answerTime")
    public Timestamp getAnswerTime() {
        return answerTime;
    }

    public void setAnswerTime(Timestamp answerTime) {
        this.answerTime = answerTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        QuestiondetailsEntity that = (QuestiondetailsEntity) o;
        return rid == that.rid && questionId == that.questionId && userId == that.userId && Objects.equals(content, that.content) && Objects.equals(answerTime, that.answerTime);
    }

    @Override
    public String toString() {
        return "QuestiondetailsEntity{" +
                "rid=" + rid +
                ", questionId=" + questionId +
                ", userId=" + userId +
                ", content='" + content + '\'' +
                ", answerTime=" + answerTime +
                '}';
    }

    @Override
    public int hashCode() {
        return Objects.hash(rid, questionId, userId, content, answerTime);
    }
}
